package com.lam.mall.entity;

import com.lam.common.validate.group.Add;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;

import java.math.BigDecimal;
import java.util.Date;
import com.lam.common.validate.annotation.DictCheck;
import com.lam.common.utils.DateUtil;
import com.lam.common.validate.annotation.DictValid;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import com.lam.common.components.dict.annotation.Dict;
import com.baomidou.mybatisplus.annotation.TableField;
import javax.validation.constraints.Null;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lam.common.base.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.lam.common.base.domain.tree.BaseTree;

/**
 * 地区管理对象 mall_area
 * 
 * @author admin
 * @date 2023-04-20
 */
@DictCheck
@TableName("mall_area")
public class Area extends BaseTree<Area> implements BaseEntity{

    /** 主键 */
    @Null(groups = Add.class, message="id必须为空")
    @TableId(type = IdType.AUTO)
    private String id;
    
    /** 名称 */
    @NotBlank(message = "名称不能为空")
    @Size(max = 100, message = "名称长度不能超过100个字符")
    private String areaName;

    /** 父id */
    private String parentId;

    /** 状态(0-不可用, 1-可用) */
    @NotNull(message = "状态不能为空")
    @DictValid(message = "无效的状态")
    @Dict(dictCode = "status_type")
    private Integer status;

    /** 更新人 */
    private String updateBy;

    /** 更新时间 */
    @JsonFormat(pattern = DateUtil.PATTERN_DEFAULT)
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    /** 备注 */
    @Size(max = 255, message = "备注长度不能超过255个字符")
    private String remark;

    @Override
	public BigDecimal getSortNo() {
		return BigDecimal.ZERO;
	} 
    
    public void setId(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    } 

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    public String getAreaName() {
        return areaName;
    }    
    
    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getParentId() {
        return parentId;
    }    
    
    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }    
    
    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }    
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }    
    
    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getRemark() {
        return remark;
    }


}
